﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;
using DataAccessLayer;

namespace ServiceLayer.Entity
{
    [DataContract]
    public class CollectionPointDetailW
    {
        int collectionPointDetailID;
        int collectionPointID;
        string collectionDate;
        string collectionTime;

        [DataMember]
        public int CollectionPointDetailID
        {
            get { return collectionPointDetailID; }
            set { collectionPointDetailID = value; }
        }

        [DataMember]
        public int CollectionPointID
        {
            get { return collectionPointID; }
            set { collectionPointID = value; }
        }

        [DataMember]
        public string CollectionDate
        {
            get { return collectionDate; }
            set { collectionDate = value; }
        }

        [DataMember]
        public string CollectionTime
        {
            get { return collectionTime; }
            set { collectionTime = value; }
        }

        public static CollectionPointDetailW convert(CollectionPointDetail collectionPointDetail)
        {
            CollectionPointDetailW u = new CollectionPointDetailW();

            u.CollectionPointDetailID = collectionPointDetail.CollectionPointDetailID;
            u.CollectionPointID = collectionPointDetail.CollectionPointID;
            u.CollectionDate = collectionPointDetail.CollectionDate.ToString();
            u.CollectionTime = collectionPointDetail.CollectionTime.ToString();

            return u;
        }

        public static List<CollectionPointDetailW> convertList(List<CollectionPointDetail> list)
        {
            List<CollectionPointDetailW> listW = new List<CollectionPointDetailW>();

            foreach (CollectionPointDetail x in list)
            {
                listW.Add(convert(x));
            }
            return listW;
        }
    }
}